package zy3;

/**
 * 图书信息类
 */
public class bookInformation {
    private String title;//书名
    private String author;//作者
    private String press;//出版社名
    private int price;//价格

    public bookInformation(){

    }

    public bookInformation(String title,String author,String press,int price){
        this.getTitle();
        this.getAuthor();
        this.press = press;
        this.setPrice(price);
    }

    public String getTitle() {
        return title = "《豪》";
    }

    public String getAuthor() {
        return author = "梁";
    }

    public String getPress() {
        return press;
    }

    public void setPress(String press) {
        this.press = press;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        if (price <= 10){
            System.err.println("价格必须大于10");
        }else {
            this.price = price;
        }
    }

    //信息介绍
    public void showBookinfo(){
            System.out.println("书名:"+title+",作者:"+author+",出版社名:"+press+",价格:"+price);
    }
}
